package Demo;

public class test {
    public static void main (String[] args) {
        int sum,a=0;
        for (int i = 1; i <1000 ; i++) {
            sum=0;
            for (int j = 1; j <i ; j++) {
                if (i%j==0){
                    sum=sum+j;
                }
            }
            if (sum==i){
                a+=1;
                System.out.println (sum);
            }
        }
        System.out.println (a);
    }
}




